{% extends 'base.html' %}

{% block head %}
    <title>Interview Details</title>
{% endblock %}

{% block content %}
<div id="interview_details">
<h1>{{ interview }}</h1>
         <p><a class="btn btn-info" href={% url 'Evaluator:edit_interview' interview.pk %}>Edit</a></p>
         <p><b>Position </b>: {{ interview.position.name }}</p>
         <p><b>Job Description </b>: {{ interview.position.technology }}</p>
         <p><b>Name </b>: {{ interview.candidate.name }}</p>
         <p><b>Date </b>: {{ interview.date|date }}</p>
         <p><b>Status </b>: {{ interview.get_status_display }}</p>
            {% if interview.question_set.pk %}
              <p><b>Result </b>: {{ interview.get_result_display }}</p>
              <p><b>Exam Link </b>: <a href={% url 'Evaluator:question_set_details' interview.question_set.pk %}>{{interview.question_set.name}}</a></p>
            {% endif %}

        {% if rounds %}
        <h3>Round Details</h3>
            <table class="table table-striped">
                <tr>
                    <th>Name</th>
                    <th>Created On</th>
                    <th>Date Scheduled</th>
                    <th>Time</th>
                    <th>Assignee</th>
                    <th>Assisting Interviewers</th>
                    <th>Type</th>
                    <th>Result</th>
                    <th>Instructions</th>
                    <th>View/Add Ratings</th>
                </tr>
            {% for round in rounds %}
            <tr>
                <td>{{ round.name }}</td>
                <td>{{ round.created_at }}</td>
                <td>{{ round.date}}</td>
                <td>{{ round.contact_time }}</td>
                <td>{{ round.assignee.username }}</td>
                <td><ul>
                    {% for interviewer in round.supporting_interviewer.all %}
                        <li>{{ interviewer.first_name }}</li>
                    {% endfor %}
                    </ul>
                </td>
                <td>{{ round.get_round_type_display  }}</td>
                <td>{{ round.get_result_display }}</td>
                <td>{{ round.comments  }}</td>
                {% if round.interviewratingsheet %}
                    <td><a href={% url 'Evaluator:rating_details' round.interviewratingsheet.pk %}>View Ratings</a></td>
                {% else %}
                    <td><a href={% url 'Evaluator:addRating' interview.pk round.pk %}>Add Ratings</a></td>
                {% endif %}

            </tr>

            {% endfor %}
        {% endif %}
    </table>
</div>
{% endblock %}
